﻿// See https://aka.ms/new-console-template for more information
using Opc.Ua;
using OpcUaHelper;

Console.WriteLine("Hello, World!");
OpcUaClient m_OpcUaClient = new OpcUaClient();
try
{

    m_OpcUaClient.UserIdentity = new UserIdentity("user", "123456");
    //m_OpcUaClient.UserIdentity = new UserIdentity(new AnonymousIdentityToken());
    await m_OpcUaClient.ConnectServer("opc.tcp://127.0.0.1:49320");

    int v = m_OpcUaClient.ReadNode<ushort>("ns=2;s=通道 1.设备 1.标记 2");
    var ss = m_OpcUaClient.BrowseNodeReference("ns=2;s=通道 1");
}
catch (Exception ex)
{

    throw;
}
finally
{
    m_OpcUaClient.Disconnect();
}


Console.ReadLine();